Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow excerpt to override integrated requests #2941

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

nickchomey
Copy link
Contributor

@nickchomey nickchomey commented Aug 12, 2022

Description of the Change

allow_excerpt_html() currently exits early when called within an AJAX or other integrated request. This replaces the simple is_admin() check with your more comprehensive (and filterable) is_integrated_request() function. The same mechanism is used in add_search_highlight_tags(), which is the only place that this function is called from.

How to test the Change

Try to do a search that includes highlighting from within an AJAX context before and after this change.

Changelog Entry

Fixed - Bug fix - Allows to replace post_excerpt with highlighted results from within AJAX and other integrated contexts.

Credits

Props @nickchomey

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

allow_excerpt_html() currently exits early when called within an AJAX request. This replaces the simple is_admin() check with your more comprehensive (and filterable) is_integrated_request() function
@felipeelia felipeelia added this to the 4.3.0 milestone Aug 23, 2022
@JakePT JakePT self-requested a review August 25, 2022 07:12
@felipeelia felipeelia merged commit 370b529 into 10up:develop Aug 25, 2022
rebeccahum added a commit to Automattic/ElasticPress that referenced this pull request Nov 9, 2022
rebeccahum added a commit to Automattic/ElasticPress that referenced this pull request Nov 9, 2022
rebeccahum added a commit to Automattic/ElasticPress that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants